#ifndef COMMON_UUID_H
#define COMMON_UUID_H

#include <string>

#include <boost/functional/hash.hpp>
#include <boost/uuid/uuid.hpp>

namespace Uuids
{

typedef boost::uuids::uuid Uuid;

std::string uuidToString(const Uuids::Uuid& uuid);
Uuids::Uuid stringToUuid(const std::string& uuid);

Uuids::Uuid nilUuid();
Uuids::Uuid newUuid();

} // namespace Uuids

namespace std
{

template <>
struct hash<Uuids::Uuid>
{
    size_t operator()(const Uuids::Uuid& uid) const
    {
        return boost::hash<Uuids::Uuid>()(uid);
    }
};

} // namespace std

#endif // COMMON_UUID_H
